package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrdersMapper {
    @Insert("insert into orders values(#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{userName},#{address},#{consignee});")
    void save(Orders orders);
    @Select("select *from orders")
    List<Orders> userPage(int page, int pageSize);
    @Select("select *from orders")
    List<Orders> find();

    List<Orders> page(@Param("page") int page,  @Param("pageSize") int pageSize, @Param("number") String number,@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
